<template>
    <div>
        <div v-if="path" id="app"><router-view/></div>
        <div v-else id="app">
            <el-container>
                <el-aside width="200px">
                    <div class="head">
                        幸福到家 运营后台
                    </div>
                    <LeftMenu/>
                </el-aside>
                <el-container>
                    <el-header>
                        <Header/>
                    </el-header>
                    <el-main><router-view/></el-main>
                    <!-- <el-footer>Footer</el-footer> -->
                </el-container>
            </el-container>
        </div>
    </div>
</template>

<script>
// @ is an alias to /src
import Header from '@/components/header.vue'
import LeftMenu from '@/components/leftMenu.vue'

export default {
    name: 'Home',
    components: {
        Header,
        LeftMenu
    },
    data() {
        return {
            path: ''
        }
    },
    created () {
        this.path = location.hash.includes('login') || location.hash.includes('test');
    },
    updated () {
        console.log('update---',location.hash);
        this.path = location.hash.includes('login') || location.hash.includes('test');
    },
    methods: {
        list() {
            let param = {
                mobile:'18268206771'
            }
            this.$api.userList({param},res=>{
                console.log(res);                
            })
        }
    }
}
</script>

<style lang="less">
#app {
    font-family: Avenir, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: center;
    color: #333;
}
.el-header, .el-footer {
    color: #333;
    text-align: center;
    line-height: 60px;
    border-bottom: 1px solid #eaeaea;
  }
  .el-header{
      box-shadow: rgba(0, 21, 41, 0.08) 0px 1px 4px;
  }
  .el-footer {
      background-color: #B3C0D1;
  }
  .el-aside {
    color: #333;
    text-align: center;
    line-height: 200px;
    background-color: rgb(0, 21, 41);
    .head{
        height: 60px;
        text-align: center;
        padding: 20px;
        box-sizing: border-box;
        display: flex;
        flex-wrap: wrap;
        color: #fff;
        font-size: 20px;
        line-height: 40px;
        .logo{
            height: 40px;
            vertical-align: middle;
        }
        .sp{
            line-height: 40px;
            margin-left: 20px;
            font-size: 20px;
        }
    }
  }
  
  .el-main {
    // background-color: #E9EEF3;
    color: #333;
    text-align: left;
    padding: 20px;
    height: calc(100vh - 61px);
  }
  
  body > .el-container {
    margin-bottom: 40px;
  }
  
  .el-container:nth-child(5) .el-aside,
  .el-container:nth-child(6) .el-aside {
    line-height: 260px;
  }
  
  .el-container:nth-child(7) .el-aside {
    line-height: 320px;
  }

</style>
